<?php session_start();
	ob_start();
	require 'php/fbsrc/facebook.php';
	include_once ("php/configs/config.php");    
	require 'php/common/facebook_util.php';
	include_once ("php/common/mysql.class.php");   //MySQL操作类
	include_once ("php/common/action.class.php");   //MySQL操作类
?>
<?php 
	$fb_id = $_COOKIE['fb_id'];
	$nickname = $_COOKIE['nickname'];
	$sex = 1;
	
	$db = new  action($mydbhost, $mydbuser, $mydbpw, $mydbname, "temp_conn", $mydbcharset, $mydbtag); //实例化数据库类

	$user_id = $db->get_userid_fbid($fb_id, $nickname, $sex);
    $cookie_value = auth_encode($user_id);
	
	setcookie("user_id", $user_id, time()+7200);
	setcookie("iridescent", $cookie_value, time()+7200); /* 鏈夋晥鏈?2涓皬鏃?*/ 
	ob_end_flush();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="cache-control" content="no-cache">
		<title>Drift Bottle</title>
		<script></script>
		<link rel="stylesheet" type="text/css" href="css/bottle.css" />
		
		
	  <!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> -->
		
<style type="text/css">
<!--
body {
 margin-left: 0px;
 margin-top: 0px;
 margin-right: 0px;
 margin-bottom: 0px;
}
-->
</style> 
  </head>
  <body>

  	<div class="beach_sand"></div>
  	<div class="wave"></div>
    <div class="container" id="bottle_container">
  		<div id="toolbar" class="bottle_toolbar">
			<div id="pick_div" class="toolbar_item" onclick="pick_bottle();">
				<img  class="throwimg" src="../images/bottle/catch.png" href="#" />
				<div class='numBg'>
					<p id='pick_p'></p>
				</div>
			</div>
			<div id="throw_div" class="toolbar_item" onclick="show_select_pannel();">
				<img  class="wreckimg" src="../images/bottle/throw.png" href="#" />
				<div class="numBg">
					<p id='throw_p'></p>
				</div>
			</div>
			<div id="mybottle_div" class="toolbar_item"  onclick="my_bottles();">
				<img  class="mybottleimg" src="../images/bottle/bottles.png" href="#" />
				<div class="numBg_r">
					<p id='unread_p'></p>
				</div>
			</div>
			
  		</div>
  	</div>
  	<div id="animators">
  		<img id="salvage" class="salvage" src="../images/salvage_ie6[1].png" />
  		<img id="bottle" class="bottle" src="../images/bottle/salvage0[1].png" /> 
  		<img id="throwTest" class="throwTest" src="../images/bottle/salvage2[1].png " />
		<span id="swiftingMsg" class="swift_msg">Your bottle's swifting farther and farther...</span>
    </div> 
	
	<div class="bottle_pannel" id="bottle_panel" >
		<div class="popup">
			<div class="content" id="content">

				<div class="bottle_message_title" >
					<div class="l_size gold bold title_text">
						<div id="bottle_title" class="title_string" >&nbsp;
						</div>
						<div class="page_index graytext" id="message_page">
							0
						</div>
						<div class="fanye">
							<a id="btn-prev_message" class="btn-prev sprite-btn">next</a>
							<a id="btn-next_message" class="btn-next sprite-btn">previous</a>
						</div>
					</div>
				</div>
				<div class="clr"></div>

				<div class="bottle_content" id="bottle_content">
					<div class="bottle_deliver" id="message_container" >
						<div class="cutline"></div>
						<div class="paper_bottom">
							<div class="paper_bottom_r"></div>
						</div>	
					</div>
				</div>

				<div class="reply_div">
					<div class="gold bold" id="reply_title">Reply:</div>
					<div class="textsend">
						<textarea class="blacktext border" id="textarea_id"></textarea>
					</div>
					<div class="reply_toolbar">
						<div class="reply_empty">&nbsp;</div>
						<div class="reply_btn"> 
							<a  class="btn " id="discard_btn">discard</a>
							<a  class="btn btn_disable" id="send_btn">send</a>
						</div>
					</div>
				</div>
			</div>
			<a class="icon ico_close_square" id="closeimg" ></a>
		</div>
    </div>

	<div id="bottle_favour" class="favour_box">
		<div class="favour_pannel self_bg" id="head_panel" >
			<div class="self_head">
				<img class="headicon" id="user_head" src="../images/heads/female2.jpg"/>
			</div>
			<div class="setting_head" id="setting_head" >

			</div>
		</div>
	</div>

<div class="setting_pannel" id="setting_pannel">
	<a class="icon ico_close_square" id="close_set_pannel"></a>
	<div class="nav_con">
		<div class="nav_infoSetting">
			<a ck="tab" tabid="1" class="bottle_tab nav_left" id="info_setting">Info</a>
			<a ck="tab" tabid="2" class="bottle_tab nav_right" id="other_setting">System</a>
		</div>
	</div>


	<div class="setting_pannel_content">
		<div class="readContentAll">
			<div class="settingContainer">
				<div class="iframecontainer">
					<div class="set_Pannel">
						<div class="active_receive" id="active_receive">
							<input type='checkbox' name='is_receive' id='checkreceive' >Receive the bottle automatically
						</div>
						<div class="set_nickname" id="set_nickname">
							<label class="label_left">Nickname：</label>
							<input type="text" value="" id="nickname" maxlength="10" class="text border">
							<div class="f_size graytext intro">most 10 characters
							</div>
						</div>
						<div class="set_sex" id="set_sex">
							<label class="label_left">Gender：</label>
							<div class="sex_select" >
								<input type="radio" name="sex" value="0" checked="checked"  /> Female
								<input type="radio" name="sex" value="1" /> Male
							</div>
						</div>
						<div class="set_area" id="set_area">
							<label class="label_left">Area：</label>
							<input type="text" value="" id="location" maxlength="20" class="text border">
							<div class="f_size graytext intro">most 20 characters
							</div>
						</div>
						<div class="operaPannel">
							<a class="btn " id="setpannel_ok">OK</a>
							<a class="btn" id="setpannel_cancel">CANCEL</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<div class="bottlelist_pannel" id="my_bottles">
	<a class="icon ico_close_square" id="close_my_pannel"></a>
	<div class="nav_con">
		<div class="nav_infoSetting">
			<a ck="tab" tabid="1" class="bottle_tab nav_left" id="receive_bottles">received</a>
			<a ck="tab" tabid="2" class="bottle_tab nav_right" id="sended_bottles">sended</a>
		</div>
		<div class="page_index graytext" id="bottle_list_page">
			0
		</div>
		<div class="fanye">
			<a id="btn-prev_bottlelist" class="btn-prev sprite-btn">next</a>
			<a id="btn-next_bottlelist" class="btn-next sprite-btn">previous</a>
		</div>
	</div>
	<div class="setting_pannel_content">
		<div class="readContentAll">
			<div class="messagelist" id="messagelist">
			</div>
		</div>
	</div>
</div>

<div class="loading_class" id="loading_id" >
	<img id="loading_img" src="../images/bottle/ico_loading.gif">
	Loading....
</div>
<div class="isok_class" id="isok_id" >
	<div class="tip_text">
		<p>Are you sure to <br>delete this bottle?</p>
	</div>
	<div class="dialog_confirm">
		<a class="btn" id='confirm_y' name="y" href="#">Yes</a>
		<a style="margin-right: 0pt;" class="btn" id='confirm_n' name="n"href="#">No</a>
	</div>
</div>

<div class="isok_class" id="fish_id" >
	<div class="tip_text">
		<p>Wow~, A big fish! <br>Pick again?</p>
	</div>
	<div class="dialog_confirm">
		<a class="btn" id='confirm_fish' href="#">Ok</a>
	</div>
</div>

<div class="isok_class" id="openbottle_id" >
	<div class="tip_text">
		<p>Got a bottle<br>Open it?</p>
	</div>
	<div class="dialog_confirm">
		<a class="btn" id='confirm_open' href="#">Yes</a>
	</div>
</div>


<div class="pannel_content bg_paper" id='select_bottle_pannel'>
	<h1 class="b_size">Choose a bottle：</h1>
	<a class="ico_close_circle_blue" href="#" id='select_bottle_close'></a>
	<div style="height: auto;" class="type_content">
		<a href="#" class="select_box" btype='0'>
			<span class="ico_bottle bottle_type0"></span>
			<p class="txt_center">Normal bottle</p>
		</a>
		<a href="#" class="select_box" btype='1'>
			<span class="ico_bottle bottle_type9"></span>
			<p class="txt_center">Secret bottle</p></a>
	</div>
	<div class="triangle"></div>
</div>
</body>

<script type="text/javascript" src="js/jquery-1.6.2.js"></script>
		<script type="text/javascript" src="js/my.jquery.rotate.js"></script>
		<script src="js/bottle.js" type="text/javascript"></script>

</html>